home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / olaptble / _setup.1 / ACODemo3.vbs < prev    next >
Encoding:
Text File  |  1998-03-20  |  2.7 KB  |  86 lines

  1. ' Demo Script ACODemo3.Vbs
  2. '
  3. ' Alpha Centauri - March 1998
  4. ' ---------------------------
  5.  
  6. Dim etFlat    ' EdgeType Constant
  7. Dim tsSpace    ' ThousandsSep Constant
  8. Dim lbShort    ' Label Constant
  9.  
  10. ' Set Constants
  11. etRaised = 0
  12. tsSpace  = 0
  13. lbShort  = 0
  14.  
  15. ' Connect to Personal Express and open the ACODemo Database
  16. Call ACOTable.Connect(False)
  17. Call ACOTable.Open("C:\PROGRA~1\ACOTABLE\ACODEMO", True)
  18.  
  19. ACOTable.AutoRefresh = FALSE
  20.  
  21. ' Remove previously selected Measures
  22. Call ACOTable.RemoveAllMeasures()
  23.  
  24. ' Set General Measure Properties
  25. ACOTable.Decimals          = 0
  26. ACOTable.ThousandsSep      = tsSpace
  27. ACOTable.EdgeTypeDown      = etFlat
  28. ACOTable.FontColor         = 255*256*256 + 0 + 0
  29. ACOTable.DownEdgeFillColor = 234*256*256 + 219*256 + 160
  30.  
  31. ' Add the following measures to the table 
  32. Call ACOTable.AddMeasure("UNITS")
  33. Call ACOTable.AddMeasure("AVGPRICE")
  34.  
  35. ' Set Labels for the measures
  36. Call ACOTable.SetMeasLabel("UNITS", lbShort, "Units")
  37. Call ACOTable.SetMeasLabel("AVGPRICE", lbShort, "Avg.Price")
  38.  
  39. ' Set specific properties for the measure UNITS
  40. Call ACOTable.SetMeasUseDisplayFormat("UNITS", TRUE)
  41. Call ACOTable.SetMeasFillColor("UNITS", 225*256*256 + 205*256 + 228)
  42.  
  43. ' Set specific properties for the measure AVGPRICE
  44. Call ACOTable.SetMeasUseDisplayFormat("AVGPRICE", TRUE)
  45. Call ACOTable.SetMeasFillColor("AVGPRICE", 205*256*256 + 228*256 + 193)
  46.  
  47. ' Set Selections on TIME & PRODUCT
  48. Call ACOTable.SetSelection("TIME", 0, "Lmt TIME To '1996\n1997\n1998';Lmt TIME add Children Using T0.PARENT")
  49. Call ACOTable.SetSelection("PRODUCT", 1)
  50.  
  51. ' Rotate dimensions
  52. ' Rotate PRODUCT & GEOGRAPHY
  53. ' Move TIME to the Across Edge
  54. Call ACOTable.Rotate("PRODUCT", "GEOGRAPHY")
  55. Call ACOTable.ChangeEdge("TIME", 1)
  56.  
  57. ACOTable.AutoRefresh = TRUE
  58.  
  59. ' Display info when clicking on a specific cell
  60. Sub ACOTable_OnLeftClick(col, row)
  61.   Call MsgBox("Dimension Values : " + _
  62.     Chr(10) + Chr(13) + Chr(10) + Chr(13) + _
  63.     "Measure        : " + _
  64.     ACOTable.GetDimValue("MEASURE", col, row, 0) + _
  65.     Chr(10) + Chr(13) + _
  66.     "Geography    : " + _
  67.     ACOTable.GetDimValue("GEOGRAPHY", col, row, 0) + _
  68.     Chr(10) + Chr(13) + _
  69.     "Product        : " + _
  70.     ACOTable.GetDimValue("PRODUCT", col, row, 0) + _
  71.     Chr(10) + Chr(13) + _
  72.     "Time        : " + _
  73.     ACOTable.GetDimValue("TIME", col, row, 0) + _
  74.     Chr(10) + Chr(13) + _
  75.     "Distribution    : " + _
  76.     ACOTable.GetDimValue("DISTRIBUTION", col, row, 0) + _
  77.     Chr(10) + Chr(13) + Chr(10) + Chr(13) + _
  78.     "Data Value     : " + _
  79.     CStr(ACOTable.GetDataValue(col, row, TRUE)) + _
  80.     Chr(10) + Chr(13), _
  81.     64, "ACOTable - " +  CStr(Now()))
  82. End Sub
  83.  
  84. Call MsgBox("Click on a data cell to get all the cell information.", _
  85.     64, "ACOTable DemoScript 3")
  86.